package com.it.reggie.Service.Impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.it.reggie.Mapper.EmployeeMapper;
import com.it.reggie.Service.EmployeeService;
import com.it.reggie.entity.Employee;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

@Service
public class EmployeeServiceImpl extends ServiceImpl<EmployeeMapper,Employee> implements EmployeeService {

    @Autowired
    private EmployeeMapper employeeMapper;

    /**
     * 判断用户名是否存在
     * @param username 用户名
     * @return 对象
     */
    @Override
    public Employee UserNameLoing(String username) {
        Employee employee = employeeMapper.UserNameLoing(username);
        return employee;
    }

    @Override
    public List<Employee> Paging(int page, int pageSize, String name) {

        List<Employee> paging = employeeMapper.Paging(page, pageSize, name);

        return paging;
    }

    @Override
    public int selectTotalCount() {
        int i = employeeMapper.selectTotalCount();
        return i;
    }


}
